<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/bootstrap.css" />

		<link rel="stylesheet" type="text/css" href="css/new_file.css" />

		<script src="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/js/jquery-2.1.4.min.js"></script>

		<script src="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/js/bootstrap.js"></script>

		<script src="js/new_file.js"></script>
	</head>
	<body>
		<button class="btn btn-primary" data-toggle="modal" data-target="#MyModal">
			点击开始
		</button>
		<div class="modal fade" id="MyModal">
			<div class="modal-dialog"><!--控制模态框宽度-->
				<!--模态框的样式进行设置-->
				<div class="modal-content">
					<!--头部-->
					<button class="close" data-dismiss="modal">
						&times;
					</button>
					<h4 class="modal-title">标题内容</h4>
					<!--主题内容-->
					<div class="modal-body">
						在这里添加一些文本
					</div>
					<!--底部-->
					<div class="modal-footer">
						<button class="btn btn-danger" data-dismiss="modal">
							关闭
						</button>
					</div>
				</div>
			</div>
		</div>
		<script>
			$(function(){
//				on绑定事件
//				keydown时进行键盘敲击
				$("body").on("keydown",function(e){
					var key=e.which;
//					当键盘为A时,进行模态框显示状态
                    if(key==65){
                    	$("#MyModal").modal("show")
                    }
//                  当键盘为b时,进行模态框关闭状态
                     if(key==66){
                     	$("#MyModal").modal("hide")
                     }
//                   当键盘为c时,进行模态框随意切换状态
                     if(key==67){
                     	$("#MyModal").modal("toggle")
                     }
				})
			})
		</script>
	</body>
</html>
